#!/bin/bash
# chop off the old shaders from the .h
sed '1,/\/\/==/ !d' $1.h >$1.new

# add new vertex shader (if exists)
if [ -e $1.vert ]; then
echo char $1_vert[] = \"\\ >>$1.new
sed 's/$/\\n\\/g' $1.vert >> $1.new
echo \"\; >>$1.new
fi

# add new fragment shader (if exists)
if [ -e $1.frag ]; then
echo char $1_frag[] = \"\\ >>$1.new
sed 's/$/\\n\\/g' $1.frag >> $1.new
echo \"\; >>$1.new
fi

#add new geometry shader (if exists)
if [ -e $1.geom ]; then
echo char $1_geom[] = \"\\ >>$1.new
sed 's/$/\\n\\/g' $1.geom >> $1.new
echo \"\; >>$1.new
fi

mv $1.new $1.h